Skip to content

fix: prevent multi-stage tests from passing when earlier stages fail#401

Merged
hfudev merged 1 commit intomainfrom
fix/multi-stage-tests
Feb 26, 2026
Merged

fix: prevent multi-stage tests from passing when earlier stages fail#401
hfudev merged 1 commit intomainfrom
fix/multi-stage-tests

Conversation

@hfudev
Copy link
Copy Markdown
Member

@hfudev hfudev commented Feb 25, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ESP-IDF Unity test runner integration to ensure multi-stage Unity tests correctly fail if any earlier stage fails (instead of potentially reporting success based only on later-stage output). It also adds a dedicated QEMU unit-test app fixture and adjusts the QEMU test expectations accordingly.

Changes:

  • Update IdfUnityDutMixin multi-stage execution flow to collect and squash failures across sub-stages into a single failing JUnit testcase.
  • Add a new unit_test_app_qemu fixture (source + prebuilt artifacts) tailored for validating multi-stage behavior under QEMU.
  • Update QEMU pytest to use the new fixture and assert the corrected JUnit pass/fail counts.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.

File Description
pytest_embedded_idf/unity_tester.py Collect failures between multi-stage subcases and ensure earlier-stage failures are reflected in final results.
pytest-embedded-qemu/tests/test_qemu.py Switches the test to the QEMU-specific unit-test fixture and updates expected JUnit totals.
tests/fixtures/unit_test_app_qemu/** Adds a QEMU unit-test app fixture (including prebuilt binaries/config) containing normal + multi-stage pass/fail cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

for sub_case in case.subcases:
if sub_case != case.subcases[0]:
self._get_ready(timeout)
ready_before = self._get_ready(timeout, return_before=True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there are multiple test cases, such as:

  • multi-stage test 1
  • multi-stage test 2

Will multi-stage test 2 have access to the before logs from multi-stage test 1? Is it possible that it could be affected by them?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. added ready_before = None as a init

Copy link
Copy Markdown
Member Author

@hfudev hfudev Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. thought it over again. i don't think it would happen.

@hfudev hfudev force-pushed the fix/multi-stage-tests branch from 50767a6 to 7457ba1 Compare February 26, 2026 17:18
@github-actions
Copy link
Copy Markdown

Title Coverage Tests Skipped Failures Errors Time
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 25.03s ⏱️
3.14 X64 Coverage 103 14 💤 1 ❌ 0 🔥 13m 55s ⏱️
3.10 ARM64 Coverage 103 16 💤 2 ❌ 0 🔥 11m 27s ⏱️

@hfudev hfudev merged commit 9dd65f3 into main Feb 26, 2026
4 of 6 checks passed
@hfudev hfudev deleted the fix/multi-stage-tests branch February 26, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants